package com.atguigu.exer;

import java.util.List;

/**
 * @author yihu
 * @create 2021-03-08 17:27
 * @email: 1057202547@qq.com
 * @dec:
 */
public class DAOTest {
    public static void main(String[] args) {
        DAO<User> userDAO = new DAO<>();
        userDAO.save("1001",new User(1001,34,"周杰伦"));
        userDAO.save("1002",new User(1002,20,"昆凌"));
        userDAO.save("1003",new User(1003,25,"蔡依林"));

        //修改
        userDAO.update("1003",new User(1003,30,"方文山"));

        userDAO.delete("1002");

        List<User> list = userDAO.list();
        list.forEach(System.out::println);
    }
}
